<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="html.RequestParser"%>
<%@page import="db.DBMain"%>
<%@page import="util.Constant"%>
<%@page import="java.util.ArrayList"%>
<%@page import="db.tables.DBCategoryTable"%>
<%@page import="db.tables.DBTypeTable"%>
<%
	Long type_id=null;
	type_id=(Long)session.getAttribute(Constant.Content.TYPE);
	
	RequestParser categoryParser=new RequestParser(request,"category.jsp","get");
	categoryParser.setAdd(Constant.Content.ADD_CATEGORY);
	categoryParser.setContent(Constant.Content.CATEGORY);
	categoryParser.setSubmit(Constant.Content.SUBMIT_CATEGORY);
	categoryParser.setDelete(Constant.Content.DELETE_CATEGORY);
	categoryParser.setInput(new String[]{Constant.Content.INPUT_CATEGORY,Constant.Content.INPUT_CATEGORY_ORDER,Constant.Content.TYPE});
	categoryParser.setInsert_columns(new String[]{DBCategoryTable.CATEGORY_NAME_COL,DBCategoryTable.CATEGORY_ORDER_COL,DBCategoryTable.TYPE_ID_COL});
	categoryParser.setDisplay_columns(new String[]{DBCategoryTable.CATEGORY_ID_COL,DBCategoryTable.CATEGORY_NAME_COL,DBCategoryTable.CATEGORY_ORDER_COL});
	categoryParser.setPk_column(DBCategoryTable.CATEGORY_ID_COL);
	categoryParser.setTable(DBMain.getCategoryTable());
	categoryParser.setFk_column(DBCategoryTable.TYPE_ID_COL);
	categoryParser.setFk_id(type_id);
	categoryParser.process();
%>
<!-- //onchange="insertvalues()" //-->
	<select name="<%=Constant.Content.CATEGORY %>" onchange="submit()">
		<%
			categoryParser.printOptionList(out);
		%>
	</select>